#include "../inc/Dog_pri.h"
#include "../../ooc/inc/class_portion.c"

#define _Dog     CP_MC_FNAME


static void finalize(_Dog* cthis);


static OOC_abstract void eat(OOC_PEN(ANIMAL_PKG, Animal)* t);
static OOC_abstract void breathe(OOC_PEN(ANIMAL_PKG, Animal)* t);
static void move(OOC_PEN(IMOVEABLE_PKG, IMoveable)* t);




_Dog* OOC_ONAME(OOC_CTOR_NAME(_Dog), a)(muc8* name, int age){
    _Dog* cthis = OOC_CTOR_NAME(_Dog)();
    
    if(MNULL == cthis)
        return MNULL;
    
    cthis->Animal->setName(cthis->Animal,name);
    cthis->Animal->setAge(cthis->Animal, age);

    
    return cthis;
}


static _Dog* CPortion_default_init(_Dog* cthis){
    assert(MNULL != cthis);
    OOC_PUB_BLOCK_TNAME(_Dog)* pPubBlock = OOC_GET_PUB_BLOCK(cthis, CP_MC_PKG, CP_MC_TYPE);

    
    cthis->Animal->eat = eat;
    cthis->Animal->breathe = breathe;
    cthis->IMoveable.move = move;
    
    return cthis;
}
//=========================================================

static void Cportion_finalize(_Dog* cthis){
    //void
}
//.......................................................................

/* 鱼的移动行为 */
static void move(OOC_PEN(IMOVEABLE_PKG, IMoveable)* t) {
     printf("move: 狗在地上跑！\n");
}

static OOC_abstract void eat(OOC_PEN(ANIMAL_PKG, Animal) * cthis){
    printf("eat: 狗吃骨头！\n");
}

static OOC_abstract void breathe(OOC_PEN(ANIMAL_PKG, Animal) * cthis){
    printf("breathe: 狗用肺呼吸！\n");
}



